﻿/*
   Copyright 2012 Dmitry Bratus

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

using System;
using Flower.Logging;
using Flower.Workflow;

namespace Flower.Client
{
    public class WorkflowLogAdapter : ILog
    {
        private readonly Log _log;

        public Log Log { get { return _log; } }

        public WorkflowLogAdapter(Log log)
        {
            _log = log;
        }

        public void Trace(string message)
        {
            _log.Trace(message);
        }

        public void Info(string message)
        {
            _log.Info(message);
        }

        public void Warning(string message)
        {
            _log.Warning(message);
        }

        public void Error(string message)
        {
            _log.Error(message);
        }

        public void Fatal(string message)
        {
            _log.Fatal(message);
        }

        public void Trace(Func<string> message)
        {
            _log.Trace(message);
        }

        public void Info(Func<string> message)
        {
            _log.Info(message);
        }

        public void Warning(Func<string> message)
        {
            _log.Warning(message);
        }

        public void Error(Func<string> message)
        {
            _log.Error(message);
        }

        public void Fatal(Func<string> message)
        {
            _log.Fatal(message);
        }

        public void Warning(string message, Exception ex)
        {
            _log.Warning(message, ex);
        }

        public void Error(string message, Exception ex)
        {
            _log.Error(message, ex);
        }

        public void Fatal(string message, Exception ex)
        {
            _log.Fatal(message, ex);
        }

        public void Warning(Func<string> message, Exception ex)
        {
            _log.Warning(message, ex);
        }

        public void Error(Func<string> message, Exception ex)
        {
            _log.Error(message, ex);
        }

        public void Fatal(Func<string> message, Exception ex)
        {
            _log.Fatal(message, ex);
        }
    }
}
